//定义服务层
app.service("studentService",function ($http) {
    //1、查询学生列表（不带分页功能）
    this.findAll= ()=>{
        return  $http.get("student/list.do");
    }
    //2.查询学生列表（带有分页功能）
    this.findByPage = (page,pagesize)=>{
        return  $http.get("student/findByPage.do?page=" + page + "&pagesize="+pagesize);
    }
    //3.查询所有的班级
    this.findClasses = ()=>{
        return  $http.get("classes/list.do");
    }
    //4.条件查询带分页
    this.search = (page,pagesize,entity)=>{
        return $http.post("student/search.do?page="+ page+"&pagesize="+ pagesize,entity);
    }
    //5.添加或修改学生
    this.save = (url,entity)=>{
        return $http.post(url,entity);
    }
    //6.根据id删除学生
    this.del = (sid)=>{
        return $http.get("student/del.do?sid="+sid);
    }
    //7.批量删除
    this.batchDel = (ids)=>{
        return $http.get("student/batchDel.do?ids=" + ids);
    }
})